package cn.cscamp.gateway.mapping;

/**
 * 网关接口映射信息
 *
 * @author whx
 */
public class HttpStatement {

    /**
     * 网关接口
     */
    private final String uri;

    /**
     * 接口类型: GET POST PUT DELETE
     */
    private final HttpCommandType httpCommandType;

    /**
     * 应用名称
     */
    private final String application;

    /**
     * 服务接口: RPC OR HTTP
     */
    private final String interfaceName;

    /**
     * 服务方法: RPC#method
     */
    private final String methodName;

    /**
     * 参数类型(RPC 限定单参数注册): new String[]{"java.lang.String"}、new String[]{"cn.cscamp.gateway.rpc.dto.XReq"}
     */
    private final String parameterType;

    /**
     * 是否鉴权；true = 是、false = 否
     */
    private final boolean auth;


    public HttpStatement(String uri,
                         HttpCommandType httpCommandType,
                         String application,
                         String interfaceName,
                         String methodName,
                         String parameterType, boolean auth) {
        this.uri = uri;
        this.httpCommandType = httpCommandType;
        this.application = application;
        this.interfaceName = interfaceName;
        this.methodName = methodName;
        this.parameterType = parameterType;
        this.auth = auth;
    }

    public String getUri() {
        return uri;
    }

    public HttpCommandType getHttpCommandType() {
        return httpCommandType;
    }

    public String getApplication() {
        return application;
    }

    public String getInterfaceName() {
        return interfaceName;
    }

    public String getMethodName() {
        return methodName;
    }

    public String getParameterType() {
        return parameterType;
    }

    public boolean isAuth() {
        return auth;
    }

}
